package com.imay.live.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.imay.live.R;

/**
 * Created by Administrator on 2017/8/30 0030.
 */

public class VideoSimpleDraweeView extends RelativeLayout {
    public VideoSimpleDraweeView(Context context) {
        this(context, null);
    }

    public VideoSimpleDraweeView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public VideoSimpleDraweeView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        LayoutInflater.from(context).inflate(R.layout.view_video_simpledrawee, this, true);
    }


    public void setImageResource(int imageResource) {
        ((ImageView) findViewById(R.id.item_sdv_img)).setImageResource(imageResource);
    }

    public ImageView getImageView() {
        return (ImageView) findViewById(R.id.item_sdv_img);
    }

    public void setVideoStatus(boolean status) {
        if (status) {
            findViewById(R.id.item_iv_img).setVisibility(VISIBLE);
        } else {
            findViewById(R.id.item_iv_img).setVisibility(INVISIBLE);
        }
    }
}
